<template>
  <view>
    <view class="set">
      <text class="ico icon-money" @tap="kefuFn"></text>
      <text class="ico icon-kefu" @tap="kefuFn"></text>
      <text class="ico icon-set" @tap="setFn"></text>
    </view>
    <view class="header">
      <view :data-photo_b="U.photo_b" class="p" @tap="photo_bFn">
        <image :src="U.photo_s" mode="aspectFill"></image>
        <view v-if="U.photo_ifshow == 0 || U.flag == -2 || U.flag == 2" class="span">
          {{ U.flag == 2 ? '注册未完成' : '已隐藏' }}
        </view>
      </view>
      <view class="nickname">
        <view class="h3" @tap="myloginFn">
          <text class="span">{{ U.nickname != '' ? U.nickname : '请点击登录' }}</text>
          <image :src="U.grade_ico" class="ugrade2" mode="aspectFill"></image>
        </view>
        <view class="h6">
          <block v-if="U.id">
            我的ID:{{ U.id }}
            <text :data-uid="U.id" class="ico icon-copyuid" @tap.stop.prevent="copyuidFn"></text>
          </block>
          <block v-else>登录/注册更精彩</block>
        </view>
      </view>
      <view
          :style="'background-image: -webkit-linear-gradient(left,rgba(' + rgbcolor + ',.5),rgba(' + rgbcolor + ',.8));'"
          class="qdbtn">
        <view class="span" @tap="qdFn">
          <block v-if="U.signflag == 1 && iflogin">
            <text class="ico"></text>
            签到
          </block>
          <text v-else>{{ U.id > 0 && iflogin ? '已签到' : '登录' }}</text>
        </view>
      </view>
      <view class="myb">
        <view class="a" @tap="followFn">
          <text class="b">{{ U.gznum }}</text>
          <text class="span">我喜欢的</text>
        </view>
        <view class="a" @tap="lovebFn">
          <text class="b">{{ U.loveb }}</text>
          <text class="span">我的{{ loveb }}</text>
        </view>
        <view v-if="ifnav.refresh == 1" class="a" @tap="refreshFn">
          <text class="b">
            <text class="ico"></text>
          </text>
          <text class="span">刷新靠前</text>
        </view>
        <view v-if="ifnav.top == 1" class="a" @tap="topFn">
          <text class="b">
            <text class="ico"></text>
          </text>
          <text class="span">置顶相亲</text>
        </view>
      </view>
    </view>
    <view class="col2">
      <view class="a" @tap="vipFn">
        <view class="h2">
          {{ U.grade_title }}
          <text class="ico"></text>
        </view>
        <view class="h6">{{ U.grade_C }}</view>
        <view class="vip">{{ U.grade == 1 ? '开通VIP' : '提升等级' }}</view>
        <view class="em ico"></view>
      </view>
      <view class="a" @tap="my_infoFn">
        <view class="h2">
          {{ U.dataflag_title }}
          <text class="ico"></text>
        </view>
        <view class="h6">{{ U.dataflag_C }}</view>
        <view :style="'background-color: rgba(' + rgbcolor + ',.04);border-color: rgba(' + rgbcolor + ',.1);'"
              class="bfbbox">
          <view
              :style="'width:' + (U.bfb_w + '%') + ';background-image:-webkit-linear-gradient(left,rgba(' + rgbcolor + ',.5),rgba(' + rgbcolor + ',.8));'"
              class="bfb">
            {{ U.myinfobfb }}%
          </view>
        </view>
        <view
            :style="'background-image:-webkit-linear-gradient(left,rgba(' + rgbcolor + ',.4),rgba(' + rgbcolor + ',1));'"
            class="em ico">
          
        </view>
      </view>
    </view>
    <view class="box view" @tap="myloginFn">
      <view class="h2">
        谁看过我
        <text class="more" @tap="browseFn2">
          我看过谁
          <text class="ico"></text>
        </text>
      </view>
      <view v-if="VU.parr.length > 0" class="ivubox" @tap="VUFn">
        <view v-for="(item, index) in VU.parr" :key="index" class="span">
          <image :class="VU.class" :src="item" mode="aspectFill"></image>
        </view>
      </view>
      <view class="h5">
        <block v-if="VU.num > 0">
          最近有
          <text class="b">{{ VU.num }}</text>
          人看过你
          <block v-if="VU.class == 'blur'">
            ，
            <text :style="'color:' + color" class="font" @tap="vipFn">{{ VU.blurstr }}</text>
          </block>
        </block>
        <view v-else class="noU">
          暂时还没有人看过你　
          <view v-if="ifnav.refresh == 1" class="a ico" @tap="refreshFn"> 提升排名</view>
        </view>
      </view>
    </view>
    <view v-if="RZ.length > 0" :style="'height:' + cert_height + ';'" class="box cert" @tap="myloginFn">
      <view class="h2" @tap="certlistFn">
        诚信认证
        <text class="more">
          <text class="ico">查看全部</text>
        </text>
      </view>
      <view class="ul my_cert">
        <view v-for="(item, index) in RZ" :key="index" :class="'li ' + item.class" :data-F="item.f" @tap="certoneFn">
          <view v-if="item.f === 'health' ||item.f === 'credit' ">
            <text v-if="item.class == 'ed'"
                  :class="['icos','alyIcon-rzico_' + item.f,]"
                  :style="'background-image:-webkit-linear-gradient(left,' + item.bg + ');'"></text>

            <text v-else :class="['icos','alyIcon-rzico_' + item.f,]"></text>
            <text class="h3">{{ item.title }}</text>
          </view>
          <view v-else>
            <text v-if="item.class == 'ed'"
                  :class="['alyIcon-rzico_' + item.f,'ico','rzico_' + item.f]"
                  :style="'background-image:-webkit-linear-gradient(left,' + item.bg + ');'"></text>

            <text v-else :class="['alyIcon-rzico_' + item.f, 'ico','rzico_' + item.f]"></text>
            <text class="h3">{{ item.title }}</text>
          </view>
        </view>
      </view>
      <view class="morebox" @tap="certmoreFn">
        <text class="ico morebtn">{{ morebtn_ico }}</text>
      </view>
    </view>
    <view class="box" @tap="myloginFn">
      <view class="h2">我的相亲</view>
      <view :style="'--color:' + color + ';'" class="appul">
        <view v-if="ifnav.tg == 1" class="a" @tap="tgFn">
<!--          <text class="alyIcon-tuiguang tuiguang"></text>-->
          <text class="alyIcon-tuiguang tuiguang"> </text>
          <text class="span">{{ tg_navtitle }}</text>
        </view>
        <view v-if="ifnav.sign == 1" class="a" @tap="signFn">
          <text class="ico sign">
            
            <text class="b">签字</text>
          </text>
          <text class="span">承诺书</text>
        </view>
        <view v-if="ifnav.hn == 1" class="a" @tap="hnFn">
          <text class="ico hn">
            
            <text class="b">人工</text>
          </text>
          <text class="span">专属顾问</text>
        </view>
        <view v-if="ifnav.qianxian == 1" class="a" @tap="qxFn">
          <text class="ico qianxian"></text>
          <text class="span">牵线记录</text>
        </view>
        <view v-if="ifnav.yuejian == 1" class="a" @tap="yjFn">
          <text class="ico yuejian"></text>
          <text class="span">约见记录</text>
        </view>
        <view v-if="ifnav.gift == 1" class="a" @tap="giftFn">
          <text class="ico">
            
            <text class="b">新</text>
          </text>
          <text class="span">礼物</text>
        </view>
        <view v-if="ifnav.money == 1" class="a" @tap="moneyFn">
          <text class="ico xqk">
            
            <text class="b">新</text>
          </text>
          <text class="span">余额账户</text>
        </view>
        <view v-if="ifnav.photo == 1" class="a" @tap="photoFn">
          <text class="ico photo"></text>
          <text class="span">相册</text>
        </view>
        <view v-if="ifnav.contact_hh == 1" class="a" @tap="hhFn">
          <text class="ico"></text>
          <text class="span">互换</text>
        </view>
        <view v-if="ifnav.xqcard == 1" class="a" @tap="xqkFn">
          <text class="ico xqk"></text>
          <text class="span">相亲卡</text>
        </view>
        <view class="a" @tap="mateshowFn">
          <text class="ico match"></text>
          <text class="span">配对</text>
        </view>
        <!--        <view class="a" @tap="onMaterialLibrary">-->
        <!--          <text class="icos alyIcon-sucaiku"></text>-->
        <!--          <text class="span">素材库</text>-->
        <!--        </view>-->
        <view v-if="GZH.flag == 1" class="a" @tap="gzfFn">
          <text class="ico xqk"></text>
          <text class="span">关注公众号</text>
        </view>
      </view>
    </view>
    <!-- parse <include src="../login.wxml"></include> -->
    <block>
      <view v-if="div_login" class="mask3 alpha0_100">
        <view
            class="div_box big_normal"
            style="--div_box_width: 82%; --div_box_height: 666rpx; background: -webkit-linear-gradient(top, #fde9ee 1%, #fff 150%); background-color: #fff"
        >
          <view :style="'border-color:rgba(' + rgbcolor + ',.2);'" class="m">
            <image mode="aspectFit" src="/static/res/img/photo_m.png"></image>
          </view>
          <view class="S22 B">登录后获得更精准推荐</view>
          <view class="loginagree">
            <checkbox-group @change="ifagreeFn">
              <label style="margin-left: -10rpx">
                <checkbox :style="'--color:' + color + ';'" value="1"></checkbox>
                <text class="C666 vmiddle">阅读并同意</text>
              </label>
            </checkbox-group>
            <navigator :style="'color:' + color" class="vmiddle" hoverClass="none"
                       url="/pagesA/about/law?kind=agreement">用户协议
            </navigator>
            <text class="C666 vmiddle">与</text>
            <navigator :style="'color:' + color + ';'" class="vmiddle" hoverClass="none"
                       url="/pagesA/about/law?kind=declara">隐私条款
            </navigator>
          </view>
          <button
              v-if="ifagree"
              :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';width:73%'"
              class="btn5 W90_"
              openType="getPhoneNumber"
              @getphonenumber="getPhoneNumber"
          >
            <text>手机号快捷登录</text>
            <text :style="'color: ' + color + ';'">私密</text>
          </button>
          <button v-else :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';width:73%'"
                  class="btn5" @tap="ifagree_passFn">
            <text>手机号快捷登录</text>
            <text :style="'color: ' + color + ';'">私密</text>
          </button>
          <view class="C666" @tap="back">
            <text style="border-bottom: #999 1px solid">暂不登录</text>
          </view>
        </view>
      </view>
    </block>
    <view class="blank"></view>
    <block v-if="sign.signflag">
      <view id="mask_sign" class="alpha0_100" @tap="singMaskFn">
        <view id="mask_gif" class="gif rotate"></view>
      </view>
      <view id="signokbox" class="scale" @tap="singMaskFn">
        <view class="signok">
          <view class="h1">好手气</view>
          <view class="hr"></view>
          <view class="h4">
            获得
            <text id="randloveb" class="font">{{ sign.num }}</text>
            个{{ loveb }}
          </view>
        </view>
      </view>
    </block>
    <view v-if="GZH.flag == 1 && GZHshow" class="mask2 alpha0_100">
      <view class="div_box big_normal" style="--div_box_width: 70%; --div_box_height: 626rpx">
        <view class="close ico" @tap="kefu_closeFn"></view>
        <view class="truename">关注公众号</view>
        <view class="kf_wxpic">
          <image :showMenuByLongpress="true" :src="GZH.ewm"></image>
        </view>
        <rich-text :nodes="GZH.tips" class="kf_text"></rich-text>
      </view>
    </view>
    <view v-if="div_data" :class="'mask3 ' + mask_class" data-maskid="div_data" @tap="mask_closeFn">
      <view :style="'--div_box_width:600rpx;--div_box_height:480rpx;--color:' + color + ';--rgbcolor:' + rgbcolor"
            class="div_box div_data"
            @tap.stop.prevent="emptyFn">
        <view class="closebtm ico" data-closekind="back" data-maskid="div_data" @tap.stop.prevent="mask_closeFn">
        </view>
        <view class="h1">请补齐资料，完成注册</view>
        <view class="C S15">赶快去完善，解锁更多功能</view>
        <view class="C S15">完成资料，上传头像，受关注度暴增</view>
        <view class="ico picico"></view>
        <view class="btn_btm btn44 ico" @tap.stop.prevent="my_infoFn">立即完善</view>
      </view>
    </view>
    <privacy-popup @agree="privacy_agree" @disagree="privacy_disagree"></privacy-popup>
  </view>
</template>

<script>
import privacyPopup from '../../components/privacyPopup/privacyPopup';

var n = require('../../@babel/runtime/helpers/defineProperty');
var t = require('../../res/www.a9a.cn.js');
var app = getApp();
var i = uni.getStorageSync('COOK_U');
export default {
  components: {
    privacyPopup
  },
  data() {
    return {
      ifonLoad: false,
      iflogin: false,
      cert_height: '320rpx',
      morebtn_ico: '',
      cert_morebtn_onoff: 'off',
      div_login: false,

      U: {
        grade: 1,
        grade_title: '会员等级',
        grade_C: '开通会员・飞速脱单',
        gznum: 0,
        loveb: 0,
        nickname: '请点击登录',
        dataflag_title: '完善资料',
        dataflag_C: '>90%可被推荐',
        photo_s: '/static/res/img/photo_m.png',
        myinfobfb: 0,
        bfb_w: 50,
        photo_b: '',
        photo_ifshow: 0,
        flag: '',
        grade_ico: '',
        id: '',
        signflag: 0
      },

      sign: {
        signflag: false,
        loveBname: '爱豆',
        num: ''
      },

      mask_class: 'alpha0_100',
      GZHshow: false,
      loveb: '',
      color: '',
      rgbcolor: '',

      ifnav: {
        refresh: 0,
        top: 0,
        tg: 0,
        sign: 0,
        hn: 0,
        qianxian: 0,
        yuejian: 0,
        gift: 0,
        money: 0,
        photo: 0,
        contact_hh: 0,
        xqcard: 0
      },

      tg_navtitle: '',

      VU: {
        parr: [],
        class: '',
        num: 0,
        blurstr: ''
      },

      RZ: [],
      MB: '',
      MB_loveb: '',

      GZH: {
        flag: 0,
        ewm: '',
        tips: ''
      },

      div_data: false,
      udata: '',
      ifagree: false
    };
  },
  onLoad: function () {
    var that = this;
    app.globalData.get_config('_ZEAI').then(function (a) {
      t.set_tabbar();
      that.setData({
        loveb: a.loveb,
        color: a.color,
        rgbcolor: t.c16_rgb(a.color)
      });
    });
    app.globalData.get_openid().then(function (t) {
      app.globalData.chklogin().then(function (t) {
        if (t) {
          that.setData({
            iflogin: true
          });
        }
      });
      that.init();
    });
  },
  onShow: function () {
    var that = this;
    var t = this;
    app.globalData.chklogin().then(function (a) {
      console.log('')
      if (a) {
        t.setData({
          iflogin: true
        });
        that.init();
      }
    });
  },
  onShareAppMessage: function () {
    return {
      imageUrl: '',
      title: '我的',
      path: '/pages/my/my'
    };
  },
  methods: {
    init: function () {
      var that = this;
      i = uni.getStorageSync('COOK_U');
      t.empty(i.openid) ||
      app.globalData.ajax({
        url: 'my.php?submitok=U',
        data: {
          openid: i.openid
        },
        success: function (a) {
          if (0 == a.flag) {
            that.setData({
              U: {
                grade: 1,
                grade_title: '会员等级',
                grade_C: '开通会员・飞速脱单',
                gznum: 0,
                loveb: 0,
                nickname: '请点击登录',
                dataflag_title: '完善资料',
                dataflag_C: '>90%可被推荐',
                photo_s: '/static/res/img/photo_m.png',
                myinfobfb: 0,
                bfb_w: 50
              }
            });
          } else {
            that.setData({
              ifonLoad: true,
              ifnav: a.ifnav,
              tg_navtitle: a.tg_navtitle,
              U: a.U,
              VU: a.VU,
              RZ: a.RZ,
              MB: a.MB,
              MB_loveb: a.MB_loveb,
              GZH: a.GZH
            });
            var i = t.get_tabbar_index('my_msg');
            if (a.btmnewnum > 0) {
              uni.setTabBarBadge({
                index: i,
                text: a.btmnewnum
              });
            } else {
              uni.removeTabBarBadge({
                index: i
              });
            }
          }
        }
      });
    },

    myloginFn: function () {
      this.iflogin ||
      uni.navigateTo({
        url: '/pages/login/login'
      });
    },

    copyuidFn: function (n) {
      var a = n.currentTarget.dataset.uid;
      t.copy_text({
        data: a
      });
    },

    singMaskFn: function () {
      this.setData(n({}, 'sign.signflag', false));
    },
    qdFn: function () {
      var that = this;
      if (this.iflogin) {
        t.empty(that.MB) || app.globalData.openSetting(that.MB),
            (i = uni.getStorageSync('COOK_U')),
            app.globalData.ajax({
              url: 'my.php',
              data: {
                submitok: 'ajax_sign',
                openid: i.openid
              },
              success: function (t) {
                if (1 == t.flag) {
                  var a;
                  var i = parseInt(that.U.loveb) + parseInt(t.sign.num);
                  that.setData(
                      (n((a = {}), 'sign.signflag', true),
                          n(a, 'sign.loveBname', t.sign.loveBname),
                          n(a, 'sign.num', t.sign.num),
                          n(a, 'U.signflag', 0),
                          n(a, 'U.loveb', i),
                          a)
                  );
                } else {
                  if ('nodata' == t.flag) {
                    that.setData({
                      mask_class: 'alpha0_100',
                      div_data: true
                    });
                  } else {
                    uni.showToast({
                      title: t.msg,
                      icon: 'none',
                      mask: true
                    });
                  }
                }
              }
            });
      } else {
        uni.navigateTo({
          url: '/pages/login/login'
        });
      }
    },

    mask_closeFn: function (t) {
      var that = this;
      var i = t.currentTarget.dataset.maskid;
      this.setData({
        mask_class: 'alpha100_0'
      });
      setTimeout(function () {
        that.setData(n({}, i, false));
      }, 400);
    },

    emptyFn: function () {
    },

    followFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/follow/follow?t=1'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    lovebFn: function () {
      t.empty(this.MB) || app.globalData.openSetting(this.MB);
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/loveb/loveb'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    moneyFn: function () {
      t.empty(this.MB_loveb) || app.globalData.openSetting(this.MB_loveb);
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/money/money'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    refreshFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/refresh/refresh'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    topFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/top/top'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    back: function () {
      this.setData({
        div_login: false
      });
    },

    VUFn: function () {
      'blur' == this.VU.class
          ? this.vipFn()
          : this.iflogin
              ? uni.navigateTo({
                url: '/myPages/browse/browse?t=1'
              })
              : uni.navigateTo({
                url: '/pages/login/login'
              });
    },

    browseFn2: function () {
      this.iflogin
          ? (t.empty(this.MB) || app.globalData.openSetting(this.MB),
              uni.navigateTo({
                url: '/myPages/browse/browse?t=2'
              }))
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    getUserProfile: function () {
      var that = this;
      var o = uni.getStorageSync('COOK_U');
      t.empty(o.flag) || t.empty(o.openid)
          ? uni.getUserProfile({
            desc: '用于完善会员资料',
            success: function (t) {
              uni.request({
                url: app.globalData.WWW + '/api/wxxcx/reg.php',
                data: {
                  submitok: 'getUserProfile',
                  openid: o.openid,
                  unionid: o.unionid,
                  nickname: t.userInfo.nickName,
                  avatarUrl: t.userInfo.avatarUrl
                },
                success: function (t) {
                  var a;
                  1 == (t = t.data).flag
                      ? that.setData(
                          (n(
                              (a = {
                                div_login: false
                              }),
                              'U.id',
                              t.U.id
                          ),
                              n(a, 'U.flag', t.U.flag),
                              n(a, 'U.nickname', t.U.nickname),
                              n(a, 'U.photo_s', t.U.photo_s),
                              a)
                      )
                      : uni.showModal({
                        content: t.msg,
                        confirmColor: that.color,
                        confirmText: '朕知道了',
                        showCancel: false,
                        success: function (n) {
                        }
                      });
                }
              });
            }
          })
          : uni.request({
            url: app.globalData.WWW + '/api/wxxcx/my.php?submitok=udata',
            data: {
              openid: o.openid
            },
            success: function (n) {
              n = n.data;
              that.setData({
                div_login: false,
                udata: n.data.udata
              });
            },
            fail: function (n) {
              uni.showModal({
                content: n,
                showCancel: false
              });
            }
          });
    },

    getPhoneNumber: function (n) {
      var that = this;
      uni.login({
        success: function (o) {
          uni.request({
            url: app.globalData.WWW + '/api/wxxcx/get_openid.php',
            data: {
              code: o.code
            },
            success: function (o) {
              o = o.data;
              i = uni.getStorageSync('COOK_U');
              app.globalData.ajax({
                url: 'get_mob.php',
                data: {
                  session_key: encodeURIComponent(o.U.session_key),
                  encryptedData: encodeURIComponent(n.detail.encryptedData),
                  iv: encodeURIComponent(n.detail.iv),
                  openid: i.openid,
                  unionid: i.unionid
                },
                success: function (n) {
                  that.init();
                  that.setData({
                    div_login: false,
                    iflogin: true
                  });
                }
              });
            }
          });
        }
      });
    },

    vipFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/pagesA/my_vip/my_vip'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    my_infoFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/pagesA/reg/reg'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    certmoreFn: function () {
      'off' == this.cert_morebtn_onoff
          ? this.setData({
            cert_morebtn_onoff: 'on',
            morebtn_ico: '',
            cert_height: '480rpx'
          })
          : this.setData({
            cert_morebtn_onoff: 'off',
            morebtn_ico: '',
            cert_height: '320rpx'
          });
    },

    certlistFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/cert/cert'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    certoneFn: function (n) {
      t.empty(this.MB) || app.globalData.openSetting(this.MB);
      var i = n.currentTarget.dataset.f;
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/cert/cert?f=' + i
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    hnFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/hongniang/hongniang'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    photoFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/photo/photo'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    mateshowFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/mateshow/mateshow'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },
    onMaterialLibrary: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/pagesA/materialLibrary/materialLibrary'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    hhFn: function () {
      this.iflogin
          ? (t.empty(this.MB) || app.globalData.openSetting(this.MB),
              uni.navigateTo({
                url: '/myPages/hh/hh?t=2'
              }))
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    giftFn: function () {
      this.iflogin
          ? (t.empty(this.MB) || app.globalData.openSetting(this.MB),
              uni.navigateTo({
                url: '/myPages/gift/gift?t=1'
              }))
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    kefuFn: function () {
      uni.navigateTo({
        url: '/pagesA/about/about'
      });
    },

    setFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/set/set'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    xqkFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/xqk/xqk?uid=' + this.U.id
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    tgFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/hnPages/tg/my'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    signFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/sign/sign'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    qxFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/hongniang/hongniang?currentTab=1'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    yjFn: function () {
      this.iflogin
          ? uni.navigateTo({
            url: '/myPages/hongniang/hongniang?currentTab=2'
          })
          : uni.navigateTo({
            url: '/pages/login/login'
          });
    },

    photo_bFn: function (n) {
      if (this.iflogin && t.ifint(this.U.id)) {
        2 == this.U.flag
            ? uni.navigateTo({
              url: '/pagesA/reg/reg'
            })
            : uni.navigateTo({
              url: '/pagesA/u/u?uid=' + this.U.id
            });
      } else {
        var a = n.currentTarget.dataset.photo_b;
        t.empty(a) ||
        uni.previewImage({
          current: a,
          urls: [a]
        });
      }
    },

    gzfFn: function () {
      this.setData({
        GZHshow: true
      });
    },

    kefu_closeFn: function () {
      this.setData({
        GZHshow: false
      });
    },

    lawFn: function (n) {
      var t = n.currentTarget.dataset.kind;
      uni.navigateTo({
        url: '/pagesA/about/law?kind=' + t
      });
    },

    ifagreeFn: function (n) {
      1 == n.detail.value
          ? this.setData({
            ifagree: true
          })
          : this.setData({
            ifagree: false
          });
    },

    ifagree_passFn: function (n) {
      uni.showToast({
        title: '请先点击同意《用户协议》和《隐私条款》',
        icon: 'none',
        mask: true,
        duration: 3000
      });
    },

    privacy_agree: function (n) {
      console.log('agree');
    },

    privacy_disagree: function (n) {
      console.log('disagree');
      uni.exitMiniProgram();
    }
  }
};
</script>
<style lang="less" scoped>
@import './my.css';
</style>
